package data_structure;

import java.util.HashMap;

public class leetcode_1207 {
    public boolean uniqueOccurrences(int[] arr) {
        int len=arr.length;
        int[] result=new int[3000];
        for(int i=0;i<len;++i){
            result[arr[i]+1000]+=1;
        }
        HashMap<Integer, Integer> map=new HashMap<>();
        for(int i=0;i<3000;++i){
            if(result[i]!=0){
                if(map.containsKey(result[i])) return false;
                map.put(result[i],i-1000 );
            }
        }
        return true;
    }
}
